﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace Maticsoft.Web
{
    public partial class search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string s = "";
            //if (!IsPostBack)
            //{

                object ZSH = Request.Form["KeyWord"];// QueryString["ZSH"];
                if (ZSH != null && ZSH.ToString().Length > 0)
                {
                    ShowInfo(ZSH.ToString().Trim());
                }
            //}

        }




        private void ShowInfo(string zsh)
        {
            Maticsoft.BLL.CERTI bll = new Maticsoft.BLL.CERTI();
            Maticsoft.Model.CERTI model = bll.GetModel(zsh);
            if(model==null)
            {
                none.Attributes.Add("font-size","16px");
                none.Text = "未找到此编号，请仔细核对编号后查询。";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "document.getElementById('tablesearch').style.display='none';document.getElementById('table1').style.display='block';document.getElementById('tdbg').style.backgroundImage='url(search/search-nei.jpg)';", true);
            }else
            {
                labzsh.Text = model.ZSH;
                jcs.Text = model.JCS;
                pm.Text = model.PM;
                jjz.Text = model.JJZ;
                bm.Text = model.BM;
                bz.Text = model.BZ;
                jgvalue.Text = model.TEMP;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "document.getElementById('tablesearch').style.display='block';document.getElementById('table1').style.display='none';", true);
            }
            //zsh.Text = model.ZSH;;
            
            //this.txtCREATEDATE.Text=model.CREATEDATE;

        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }
    }
}
